package com.wxsh.service.impl;

import java.util.ArrayList;
import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.wxsh.entity.VocTb;
import com.wxsh.mapper.VocTbDAO;
import com.wxsh.service.VocTbService;

@Service
public class VocTbServiceImpl implements VocTbService {

	@Autowired
	private VocTbDAO vocTbDAO;
	
	@Override
	public List<VocTb> findByWord(String word) {
		List<VocTb> vocTbs = vocTbDAO.selectByWord(word.trim());
		if(vocTbs == null){
			return new ArrayList<VocTb>(0);
		}
		return vocTbs;
	}

	@Override
	public VocTb findById(int id) {
		return vocTbDAO.selectByPrimaryKey(id);
	}
	
	

}
